package services

import (
	"GOPAAS/internal/app/model"
)

type ProductCategoryService struct {
	model.ProductPublicCategory
}

func GetProductCategoryService(uid int64) *ProductCategoryService {
	db = getDB()
	var ProductCategory model.ProductPublicCategory
	if uid > 0 {
		db.First(&ProductCategory, uid)
	}
	return &ProductCategoryService{ProductCategory}
}

// GetProductCategory 获取产品分类
func GetProductCategory() (res []Area) {
	db = getDB()
	db.Model(&model.ProductPublicCategory{}).Where("parent_id is null").Find(&res)
	return
}
